function [output] = ppm_demod (size, input)
% Function for PPM Demodulation.
% size: Size of PPM

len = length(input) / size;
output = zeros(1, len);

for i=1:len
    for j=0:size-1
        if (input(size*(i-1)+j+1) > 0.5)
            output(i)=j;
            break;
        end
    end
end


